import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    namespaced: true,
    state: {
        isShowWeatherPage: false, //是否显示天气页面
        isShowPopUp: false, //是否显示底部弹出层
        isShowUserCenter: false, //是否显示用户中心
        isShowReservation: false, //是否显示服务预约模块
        isShowOrderList: false, //是否显示订单信息
        itemAttr: '', //属性信息字段
    },
    getters: {
        getShowPopUp: (state) => {
            return state.isShowPopUp
        },
        getIsShowWeatherPage: (state) => {
            return state.isShowWeatherPage
        },
        getIsShowUserCenter: (state) => {
            return state.isShowUserCenter
        },
        getIsShowReservation: (state) => {
            return state.isShowReservation
        },
        getIsShowOrderList: (state) => {
            return state.isShowOrderList
        },
        getItemAttr: (state) => {
            return state.itemAttr
        },
    },
    mutations: {
        setShowPopUp(state, payload) {
            state.isShowPopUp = payload
        },
        setIsShowWeatherPage(state, payload) {
            state.isShowWeatherPage = payload
        },
        setIsShowUserCenter(state, payload) {
            state.isShowUserCenter = payload
        },
        setIsShowReservation(state, payload) {
            state.isShowReservation = payload
        },
        setIsShowOrderList(state, payload) {
            state.isShowOrderList = payload
        },
        setItemAttr(state, payload) {
            state.itemAttr = payload
        },
    },
    actions: {
        setShowPopUp({ commit }, payload) {
            commit('setShowPopUp', payload)
        },
        setIsShowWeatherPage({ commit }, payload) {
            commit('setIsShowWeatherPage', payload)
        },
        setIsShowUserCenter({ commit }, payload) {
            commit('setIsShowUserCenter', payload)
        },
        setIsShowReservation({ commit }, payload) {
            commit('setIsShowReservation', payload)
        },
        setIsShowOrderList({ commit }, payload) {
            commit('setIsShowOrderList', payload)
        },
        setItemAttr({ commit }, payload) {
            commit('setItemAttr', payload)
        },
    },
    modules: {},
})